Skip to content

feat: add runtime system and gesture commands#415

Merged
thymikee merged 1 commit into
mainfrom
codex/runtime-system-gestures
Apr 16, 2026
Merged

feat: add runtime system and gesture commands#415
thymikee merged 1 commit into
mainfrom
codex/runtime-system-gestures

Conversation

@thymikee

@thymikee thymikee commented Apr 16, 2026

Copy link
Copy Markdown
Member

Summary

Adds runtime-owned phase 2 system/device commands and phase 3 gesture commands behind typed backend primitives.

Splits interaction target resolution into a shared command module so click/fill and the new focus/longPress/swipe/scroll/pinch commands use the same selector/ref/point semantics. Adds system result unions, router bindings, catalog entries, conformance coverage, runtime tests, and docs/skill notes for clipboard sensitivity and macOS inspect-only gesture limits.

Touched-file count: 17. Scope stayed within the planned runtime command/backend/conformance modules plus targeted docs/skill notes requested during review.

Validation

  • pnpm format
  • pnpm test:unit src/__tests__/runtime-interactions.test.ts
  • pnpm check:quick
  • pnpm check:unit

@github-actions

github-actions Bot commented Apr 16, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstackincubator.github.io/agent-device/pr-preview/pr-415/

Built to branch gh-pages at 2026-04-16 13:21 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ee2e42137c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/interaction-gestures.ts Outdated
Comment on lines +275 to +276
const target = options.target ?? { kind: 'viewport' as const };
if (target.kind === 'viewport') return { kind: 'viewport' };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject viewport scroll on inspect-only macOS surfaces

resolveScrollTarget returns a viewport target immediately when target is omitted or set to viewport, so this path never runs through resolveInteractionTarget (which is where assertSupportedInteractionSurface is enforced). On macOS desktop/menubar sessions, interactions.scroll can therefore execute backend gestures even though those surfaces are intended to be inspect-only, leading to unintended host-level scrolling.

Useful? React with 👍 / 👎.

Comment on lines +313 to +314
const capture = await captureInteractionSnapshot(runtime, options, false);
const viewport = resolveSnapshotViewport(capture.snapshot.nodes);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject directional swipe on inspect-only macOS surfaces

When swipe is invoked with a direction but no explicit from, resolveSwipeFrom goes straight to snapshot capture and viewport-center calculation without checking the interaction surface. That bypasses the macOS desktop/menubar guard used by target-resolved interactions, so unsupported swipes can be sent to inspect-only surfaces.

Useful? React with 👍 / 👎.

Comment on lines +246 to +247
const centerTarget = options.center
? await resolveInteractionTarget(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Enforce surface checks for pinch without center target

pinchCommand only calls resolveInteractionTarget when options.center is provided, but immediately invokes backend.pinch when center is omitted. Since surface restrictions are enforced in target resolution, interactions.pinch({ scale }) bypasses the macOS desktop/menubar safety gate and can run gestures on sessions that should remain inspect-only.

Useful? React with 👍 / 👎.

Comment thread src/commands/interaction-gestures.ts Outdated
Comment on lines +399 to +403
const rects = nodes.map((node) => node.rect).filter(isUsableRect);
if (rects.length === 0) {
throw new AppError('COMMAND_FAILED', 'Cannot infer viewport for directional swipe');
}
const minX = Math.min(...rects.map((rect) => rect.x));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Derive directional swipe origin from visible viewport

resolveSnapshotViewport computes bounds from every node rect in the snapshot. Because snapshots can contain off-screen elements (for example, deep list content), these aggregate min/max bounds may place the derived center outside the visible frame, so direction-only swipes start off-screen and often no-op or hit the wrong area.

Useful? React with 👍 / 👎.

@thymikee thymikee force-pushed the codex/runtime-system-gestures branch from ee2e421 to 457147a Compare April 16, 2026 13:18
@thymikee thymikee force-pushed the codex/runtime-system-gestures branch from 457147a to 32c247d Compare April 16, 2026 13:20
@thymikee thymikee merged commit afcd375 into main Apr 16, 2026
15 checks passed
@thymikee thymikee deleted the codex/runtime-system-gestures branch April 16, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant